import 'package:flutter/material.dart';
import 'package:online_study/base/round_image.dart';
import 'package:online_study/theme/colors.dart';
import 'package:online_study/theme/size.dart';

//必须课程的列表item
class RequiredCourseItem extends StatefulWidget {
  @override
  _RequiredCourseItemState createState() => _RequiredCourseItemState();
}

class _RequiredCourseItemState extends State<RequiredCourseItem> {
  @override
  Widget build(BuildContext context) {
    return Container(
      padding: EdgeInsets.only(
          left: ThemeSize.width19,
          right: ThemeSize.width19,
          bottom: ThemeSize.height8),
      color: ThemeColor.colorWhite,
      child: Column(
        crossAxisAlignment: CrossAxisAlignment.start,
        children: [
          Container(
            padding: EdgeInsets.symmetric(vertical: ThemeSize.height12),
            child: Row(
              children: [
                RoundImagePage(
                  width: ThemeSize.width110,
                  height: ThemeSize.height80,
                  radius: ThemeSize.height8,
                ),
                Expanded(
                  child: Container(
                    padding: EdgeInsets.only(left: ThemeSize.width12),
                    child: Column(
                      crossAxisAlignment: CrossAxisAlignment.start,
                      children: [
                        Text(
                          "员工日常行为规范",
                          style: TextStyle(
                              color: ThemeColor.color333333,
                              fontSize: ThemeSize.sp13,
                              fontWeight: FontWeight.bold),
                        ),
                        Padding(
                          padding: EdgeInsets.only(top: ThemeSize.height6),
                          child: Text(
                            "员工行为“十不准”",
                            style: TextStyle(
                                color: ThemeColor.color333333,
                                fontSize: ThemeSize.sp13),
                          ),
                        ),
                        Padding(
                          padding: EdgeInsets.only(top: ThemeSize.height18),
                          child: Row(
                            children: [
                              Expanded(
                                child: Text(
                                  "已学习：100%",
                                  style: TextStyle(
                                      color: ThemeColor.color555555,
                                      fontSize: ThemeSize.sp10),
                                  textAlign: TextAlign.start,
                                ),
                              ),
                              Expanded(
                                child: RichText(
                                  text: TextSpan(children: <InlineSpan>[
                                    TextSpan(
                                        text: "最高成绩：",
                                        style: TextStyle(
                                            color: ThemeColor.color555555,
                                            fontSize: ThemeSize.sp10)),
                                    TextSpan(
                                        text: "95",
                                        style: TextStyle(
                                            color: ThemeColor.colorFA5151,
                                            fontSize: ThemeSize.sp13)),
                                  ]),
                                ),
                              ),
                            ],
                          ),
                        ),
                      ],
                    ),
                  ),
                ),
              ],
            ),
          ),
          Text("要求时间：2021-03-20至2021-03-25",
              style: TextStyle(
                  color: ThemeColor.color555555, fontSize: ThemeSize.sp10)),
          Padding(
            padding: EdgeInsets.only(top: ThemeSize.height8),
            child: Text(
              "学习完成时间：2021-03-22",
              style: TextStyle(
                  color: ThemeColor.color555555, fontSize: ThemeSize.sp10),
            ),
          ),
          Padding(
            padding: EdgeInsets.only(top: ThemeSize.height8),
            child: Text(
              "首次训练达标：2021-03-23",
              style: TextStyle(
                  color: ThemeColor.color555555, fontSize: ThemeSize.sp10),
            ),
          )
        ],
      ),
    );
  }
}
